/**
 * 系统统计相关类型定义
 */

// 首页统计数据
export interface DashboardStats {
  total_items: string; // API返回的是字符串
  favorite_items_count: number;
  price_rising: number;
  price_falling: number;
  top_favorite_items: Array<{
    id: number;
    name: string;
    image_url: string;
    favorite_count: number;
    grade?: number; // 物品等级，可选字段
  }>;
}

// 价格变动物品
export interface PriceChangeItem {
  id: number;
  object_id: number;
  name: string;
  image_url: string;
  current_price: number;
  previous_price: number;
  change_value: number;
  change_percentage: number;
  trend: 'up' | 'down' | 'stable';
  favorite_count?: number; // 收藏数量，可选字段
  grade?: number; // 物品等级，可选字段
}

// 价格上涨物品
export interface PriceIncreaseItem {
  id: number;
  name: string;
  image_url: string;
  current_price: number;
  previous_price: number;
  increase_rate: number;
  change_type: 'increase';
  grade?: number; // 物品等级，可选字段
}

// 价格下跌物品
export interface PriceDecreaseItem {
  id: number;
  name: string;
  image_url: string;
  current_price: number;
  previous_price: number;
  decrease_rate: number;
  change_type: 'decrease';
  grade?: number; // 物品等级，可选字段
}

// 价格变动列表响应
export interface PriceChangeItemsList {
  increase_items: PriceIncreaseItem[];
  decrease_items: PriceDecreaseItem[];
}

// 地图密码
export interface MapPassword {
  daba: number | null;
  changgong: number | null;
  bakeshi: number | null;
  hangtian: number | null;
  chaoxijianyu: number | null; // 潮汐监狱
}

// 趋势数据点
export interface TrendDataPoint {
  date: string;
  value: number;
}

// 子弹趋势数据
export interface BulletTrend {
  period: string;
  data: TrendDataPoint[];
  statistics: {
    min_value: number;
    max_value: number;
    avg_value: number;
    change_value: number;
    change_percent: number;
  };
}

// 哈夫币趋势数据
export interface HafcoinTrend {
  period: string;
  data: TrendDataPoint[];
  statistics: {
    min_value: number;
    max_value: number;
    avg_value: number;
    change_value: number;
    change_percent: number;
  };
}
